Mac OS 8.5 Technote: Part XXVII

Copyright 1998 by Apple Computer, Inc. All Rights Reserved.

[Previous section] [Mac OS 8.5 Contents Page] [Next section]

Inside the System File (Continued)

InterfaceLib

InterfaceLib provides a Code Fragment Manager interface to many of the Mac OS routines on PowerPC-based computers. The following additions and changes are present in this most recent version of the InterfaceLib.
  • The low-memory accessor LMGetABusVars is now deprecated and should not be used, as it behaves differently on 68K and PowerPC computers. The new accessor LMGetABusGlobals that retrieves the long at 0x02D8 should be used in its place. LMGetABusVars will continue to return the value 0x02D8. The following new accessors were added: LMGetABusGlobals, LMSetABusGlobals, LMGetABusDCE, and LMSetABusDCE.

  • The following low-memory accessors have been added. They are useful for determining how long it has been since any user activity has occurred.

    • LMGetKeyTime -- the value returned by TickCount when the last keystroke was received.

    • LMGetMBTicks -- the value returned by TickCount when the mouse button was last pressed.

    Formerly, these values could be accessed using the routines shown in Listing 2.

    Listing 2. Low-memory accessors for KeyTime and MBTicks.

    long LMGetMBTicks (void)
    { return (*(long *)0x016E); } long LMGetKeyTime (void)
    { return (*(long *)0x0186); }

    Also, routines for setting these values have also been added: LMSetKeyTime and LMSetMBTicks.

  • AddDrive

    There was a problem in the parameter handling of the PowerPC AddDrive glue code in InterfaceLib that would mangle the drive number before it was called through to the 68K code. This problem has been corrected.

  • New Alias Manager routines

    IsAliasFile, ResolveAliasWithMountFlags, and ResolveAliasFileWithMountFlags are now included in InterfaceLib.

  • New routines added to InterfaceLib that were previously only available from 68K code:

    DriverInstall, DriverInstallReserveMem, DIXFormat, DIXZero, DIReformat, PBUnmountVolImmed, ReallocateHandleSys, LockMemoryForOutput, MakeMemoryResident, ReleaseMemoryData, MakeMemoryNonResident, FlushMemory, InstallExtensionNotificationProc, RemoveExtensionNotificationProc, InstallExtensionTableHandlerProc, RemoveExtensionTableHandlerProc, FlushCodeCacheRange, NewCServiceWindow, UCTextServiceEvent, and ataManager

  • The rest of the PurgeSpace calls that were previously only available from 68K code have been added to InterfaceLib:

    PurgeSpaceTotal, PurgeSpaceContiguous, PurgeSpaceSysTotal, and PurgeSpaceSysContiguous

  • All the File System Manager calls have been added to InterfaceLib:

    UTAllocateFCB, UTReleaseFCB, UTLocateFCB, UTLocateNextFCB, UTIndexFCB, UTResolveFCB, UTAllocateVCB, UTAddNewVCB, UTDisposeVCB, UTLocateVCBByRefNum, UTLocateVCBByName, UTLocateNextVCB, UTAllocateWDCB, UTReleaseWDCB, UTResolveWDCB, UTFindDrive, UTAdjustEOF, UTSetDefaultVol, UTGetDefaultVol, UTEjectVol, UTCheckWDRefNum, UTCheckFileRefNum, UTCheckVolRefNum, UTCheckPermission, UTCheckVolOffline, UTCheckVolModifiable, UTCheckFileModifiable, UTCheckDirBusy, UTParsePathname, UTGetPathComponentName, UTDetermineVol, UTGetBlock, UTReleaseBlock, UTFlushCache, UTMarkDirty, UTTrashVolBlocks, UTTrashFileBlocks, UTTrashBlocks, UTCacheReadIP, UTCacheWriteIP, UTBlockInFQHashP, UTVolCacheReadIP, UTVolCacheWriteIP, InstallFS, RemoveFS, SetFSInfo, GetFSInfo, InformFSM, and InformFFS

  • The following DriverServicesLib calls have been added to InterfaceLib:

    BlockZero, BlockZeroUncached, IncrementAtomic, DecrementAtomic, AddAtomic, BitAndAtomic, BitOrAtomic, BitXorAtomic, CompareAndSwap, IncrementAtomic8, DecrementAtomic8, AddAtomic8, BitAndAtomic8, BitOrAtomic8, BitXorAtomic8, IncrementAtomic16, DecrementAtomic16, AddAtomic16, BitAndAtomic16, BitOrAtomic16, BitXorAtomic16, TestAndSet, and TestAndClear.

    Previously these routines were documented as only available to native drivers ('ndrv's). The InterfaceLib versions of these routines can be called by other types of code.

COMPATIBILITY NOTE
Developers linking against newer versions of InterfaceLib who would like to have their products run with previous versions of the system software should weak-link against the new symbols. Unless this is done, the Code Fragment Manager will refuse to launch applications using the new symbols when an older version of InterfaceLib is being used. Developers weak-linking against any of the new symbols in InterfaceLib should check to ensure that the routines they weak-link against are defined before calling them.

Related Materials:

[Previous section] [Mac OS 8.5 Contents Page] [Next section]

To contact us, please use the Contact Us page.